home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 4 / Amiga Tools 4.iso / grafix / raytracing / raylab / source / typedef.h < prev   
C/C++ Source or Header  |  1996-01-04  |  2KB  |  155 lines

  1. /*
  2.     name:    typedef.h
  3.  
  4.     Type-defenitions
  5.     ----------------
  6.  
  7.     These defenitions are convenient for handling rays, objects etc.
  8.  
  9. */
  10.  
  11. typedef struct Point_Struct POINT;
  12. typedef struct Vector_Struct VECTOR;
  13. typedef struct TransformEntry_Struct TRANSFENTRY;
  14. typedef struct Transform_Struct TRANSFORM;
  15. typedef struct Texture_Struct TEXTURE;
  16. typedef struct Color_Struct COLOR;
  17. typedef struct ColorMap_Struct COLORMAP;
  18. typedef struct Line_Struct LINE;
  19. typedef struct Plane_Struct PLANE;
  20. typedef struct Sphere_Struct SPHERE;
  21. typedef struct Ellipsoid_Struct ELLIPSOID;
  22. typedef struct Triangle_Struct TRIANGLE;
  23. typedef struct Box_Struct BOX;
  24. typedef struct Disc_Struct DISC;
  25. typedef struct Cylinder_Struct CYLINDER;
  26. typedef struct Light_Struct LIGHT;
  27. typedef struct Camera_Struct CAMERA;
  28. typedef struct Object_Struct OBJECT;
  29.  
  30.  
  31. struct Point_Struct
  32. {
  33.     double    x, y, z;
  34. };
  35.  
  36. struct Vector_Struct
  37. {
  38.     double    x, y, z;
  39. };
  40.  
  41. struct TransformEntry_Struct
  42. {
  43.     long    Type;
  44.     VECTOR    Values;
  45. };
  46.  
  47. struct Transform_Struct
  48. {
  49.     long    NumTransforms;
  50.     TRANSFENTRY Entry[10];
  51. };
  52.  
  53. struct Color_Struct
  54. {
  55.     double    r, g, b;
  56. };
  57.  
  58. struct ColorMap_Struct
  59. {
  60.     long    LastBound;
  61.     double    Bounds[10];    /* Note: MUST BE SORTED IN ASCENDING ORDER! */
  62.     COLOR    Colors[10];
  63. };
  64.  
  65. struct Texture_Struct
  66. {
  67.     COLORMAP CMap;
  68.     long    Pattern;
  69.     COLOR    Reflect;
  70.     COLOR    Filter;
  71.     double    Ior;
  72.     double    Ambient;
  73.     double    Diffuse;
  74.     double    Phong;
  75.     double    PhongSize;
  76.     TRANSFORM Transform;
  77. };
  78.  
  79.  
  80. struct Line_Struct
  81. {
  82.     POINT    Origin;
  83.     VECTOR    Direction;
  84. };
  85.  
  86. struct Plane_Struct
  87. {
  88.     VECTOR    Normal;
  89.     double    a;
  90. };
  91.  
  92. struct Sphere_Struct
  93. {
  94.     POINT    Centre;
  95.     double    r;
  96. };
  97.  
  98. struct Ellipsoid_Struct
  99. {
  100.     POINT    Centre;
  101.     VECTOR    Radius;
  102. };
  103.  
  104. struct Triangle_Struct
  105. {
  106.     POINT    Corners[3];
  107.     POINT    Min;
  108.     POINT    Max;
  109.     PLANE    Plane;
  110. };
  111.  
  112. struct Box_Struct
  113. {
  114.     POINT    Corners[2];
  115.     PLANE    Planes[6];
  116. };
  117.  
  118. struct Disc_Struct
  119. {
  120.     POINT    Centre;
  121.     double    r;
  122.     PLANE    Plane;
  123. };
  124.  
  125. struct Cylinder_Struct
  126. {
  127.     POINT    Ends[2];
  128.     double    r;
  129.     DISC    Discs[2];
  130. };
  131.  
  132. struct Light_Struct
  133. {
  134.     POINT    Location;
  135.     COLOR    Color;
  136. };
  137.  
  138. struct Camera_Struct
  139. {
  140.     POINT    Location;
  141.     POINT    ViewPoint;
  142.     VECTOR    Direction;
  143.     VECTOR    Up;
  144.     VECTOR    Right;
  145.     VECTOR    Aspect;
  146. };
  147.  
  148. struct Object_Struct
  149. {
  150.     long    ShapeType;
  151.     void    *Shape;
  152.     TEXTURE    Texture;
  153.     TRANSFORM Transform;
  154. };
  155.